<template>
  <div class="fas-icon-list">
    <div v-for="(item, index) in iconList" :key="index" 
         :class="{'is-selected': item == currSelect}" @click="selectedIcon(item)">
      <i :class="iconPrefix + item" :title="item"/>
    </div>
  </div>
</template>

<script>
export default {
  name: 'selectIcon',
  props: ['currSelect'],
  inject: ['iconPrefix'],
  data () {
    return {
      name: '',
      iconList: ['home','setUp','user','customer','config','dept','notice','audit','log','point']
    }
  },
  methods: {
    selectedIcon (name) {
      this.$emit('selected', name);
    }
  }
}
</script>

<style lang="less" scoped>
.fas-icon-list {
  max-width: 300px;
  & > div {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
  }
  i {
    cursor: pointer;
  }
}
</style>
